<template>
  <div>
  <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newList" :key="item.id">

					<router-link :to="'/home/newInfo/'+item.id" class="">
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
            <h4>{{item.title}}</h4>
						<div class="mui-media-body">
							<span>发表时间:{{item.add_time  | dateFormat}}</span> <span>点击:{{item.click}}次</span>
						</div>
					</router-link>

				</li>
			</ul>
  </div>
</template>


<script>
export default {
  data(){
    return {
      newList:[]
    }
  },
  created(){
    this.getNewList()
  },
  methods : {
    getNewList(){
      this.$http.get('api/getnewslist').then(result=>{
        this.newList=result.body.message;
        console.log(result.body.message);
      })
    }
  }
}
</script>

<style scoped>
.mui-media-body {
  font-size: 12px;
  color: cornflowerblue;
  display: flex;
  justify-content: space-around;
}
h4 {
  font-size: 15px;
  color: rgb(75, 69, 69);
}
.mui-table-view {
  padding: 0 15px;
}
</style>
